<?php

class BaseAction extends Action {
  public $_dev = 0;
  public $_uid = 0;
  function _initialize() {
    header('content-Type=text/html;charset=utf-8');
    $this->_dev = C("DEV_FLAG");
//    if ($this->_dev == 1) {
//      $this->_uid = 5919;
//    }else {
//      $this->checkCookie();
//      $this->_uid = $_COOKIE['tpxslmluserid'];
//    }
    $this->checkCookie();
    $this->_uid = $_COOKIE['tpxslmluserid'];
  }
  
  private function checkCookie() {
//    $url = "http://localhost/pw8/login.php";
//    if ($this->_dev == 0) $url = "http://www.ehs.cn/pw8/login.php";
//    $url = "/pw8/login.php";
    if(!$_COOKIE['tpxslmlusername'] and !$_COOKIE['tpxslmluserid'] and !$_COOKIE['tpxslmlgroupid'] and !$_COOKIE['tpxslmlrnd']) {
      $this->assign('jumpUrl', '/pw8/login.php');
      $this->error('请登录');
      //redirect($url, 1, "您还没有登陆，请重新登陆，1秒后页面跳转~~");
    }
  }
}
?>